-
Notifications
You must be signed in to change notification settings - Fork 33
[BR-1794]: Add server error retry with exponential backoff #1848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/retry-with-backoff
Are you sure you want to change the base?
[BR-1794]: Add server error retry with exponential backoff #1848
Conversation
Deploying drive-web with
|
| Latest commit: |
83dcf5f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://1ae87a65.drive-web.pages.dev |
| Branch Preview URL: | https://feature-retry-with-backoff-s.drive-web.pages.dev |
- Extend retry mechanism to handle server errors (5xx), CORS errors, and network failures with exponential backoff - Add RetryReason enum to distinguish between rate limit and server error retries - Update onRetry callbacks to include retry reason parameter - Add HTTP status codes for server errors (500, 502, 503, 504) to constants - Add CORS to ErrorMessages enum - Rename retry-with-rate-limit to retry-with-backoff to reflect broader functionality - Improve test coverage and descriptions
c65f899 to
31b200e
Compare
|
| it('when server error persists then throws after max retries', async () => { | ||
| const mockFn = vi.fn().mockRejectedValue({ status: 500, message: 'Server Error' }); | ||
|
|
||
| await expect(retryWithBackoff(mockFn, { maxRetries: 2 })).rejects.toEqual({ status: 500, message: 'Server Error' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't maxRetries=5 by default?
|
LGTM. Math is what everyone else uses for computing time variation, even if Sonar complains. Btw, @CandelR @larry-internxt Maybe it's easier and cleaner if we use a third-party library for retries? |



Description
For more context please see this comment.
exponential backoff
Related Issues
Related Pull Requests
Checklist
Testing Process
Additional Notes